Device and method for entropy encoding of information words and device and method for decoding entropy-encoded information words

ABSTRACT

A method and a device for entropy encoding and associated decoding make use of a code consisting on the one hand of a code table with reversible code words ( 12 ) and comprising on the other hand an escape region for information words to be coded which are located outside the region ( 14 ) defined by said code table. Said region can be selected in such a way that a major part of the information words is coded with symmetrical code words by the code table. On the one hand, it is thus possible to carry out, in addition to forward decoding, also backward decoding ( 24 ) and on the other hand, use of reversible code words allows for rapid recognition of errors in a code word stream transmitted over a non-ideal channel.

The present invention relates to a conception for entropy encoding andto a corresponding conception for decoding entropy-encoded informationwords. In particular, the present invention relates to error-safeentropy encoding and corresponding decoding of audio signals.

Modern audio coding and decoding methods, respectively, operating forexample according to the standard MPEG layer 3, are capable ofcompressing the data rate of audio signals e.g. by a factor of 12,without notably deteriorating the quality thereof. For obtaining suchhigh data reduction, an audio signal is sampled, thereby obtaining asequence of time-discrete sampling values. As is known in technology,this sequence of time-discrete sampling values is windowed by means ofsuitable window functions, so as to obtain windowed blocks of timesampled values. A block of time windowed sampling values then istransformed to the frequency domain by means of a filter bank, amodified discrete cosine transform (MDCT) or another suitable means, forobtaining spectral values which in total represent the audio signal,i.e. the time window established by the block of time-discrete samplingvalues, in the frequency domain. Usually, time blocks with an overlap of50% are produced and transformed to the frequency domain by means of aMDCT so that, due to the specific properties of the MDCT, for example1024 time-discrete sampling values always result in 1024 spectralvalues.

It is known that the receptivity of the human ear is dependent on theinstantaneous spectrum of the audio signal itself. This dependency isnoted in the so-called psychoacoustic model, by means of which it hasbeen possible for quite some time to calculate masking thresholds inaccordance with the instantaneous spectrum. Masking means that aspecific sound or spectral component is concealed, for example, if anadjacent spectral region is of relatively high energy. This fact ofmasking is exploited for quantizing the spectral values present afterthe transform as roughly as possible. Therefore, endeavors are beingmade to avoid audible disturbances in the again decoded audio signal onthe one hand and to utilize as few bits as possible for coding, or inthe instant case quantizing, the audio signal on the other hand. Thedisturbances introduced by quantization, i.e. the quantization noise,should be below the masking threshold and thus should be inaudible. Inaccordance with known methods, a classification of the spectral valuesto so-called scale factor bands is carried out, which are supposed tocorrespond to the frequency groups of the human ear. Spectral valueswithin a spectral value group are multiplied by a scale factor in orderto scale spectral values of a scale factor band in total. The scalefactor bands scaled by the scale factor then are quantized, whereuponquantized spectral values are formed. Of course, grouping into scalefactor bands is not decisive. However, it is employed in the standardMPEG layer 3 and the standard MPEG-2 AAC (AAC=Advanced Audio Coding).

A very essential aspect of data reduction consists in entropy encodingof the quantized spectral values, which takes places after quantizing.For entropy encoding, Huffman coding is usually employed. Huffman codingis understood to be a variable length coding, i.e. the length of thecode word for a value to be coded is dependent on the occurrenceprobability thereof. The most probable symbol logically has the shortestcode, i.e. the shortest code employed is an unsymmetrical fixed lengthcode, into which a symmetrical variable length code is mixed such that aspecific number of bits of a fixed length code word is followed by a bitof a symmetrical variable length code word. The symmetrical variablelength code words merely serve to provide for error robustness and donot carry useful information. On the receiver side, the symmetricalvariable length code words are first extracted and analyzed with respectto transmission errors.

What is disadvantageous with respect to this mixed code is the fact thatit is not possible to ascertain errors occurring in the fixed lengthcode words, as only the symmetrical variable length code words areexamined. On the other hand, disturbance-free fixed length code wordscan be identified as being error-inflicted if the associated variablelength code words contain disturbances.

U.S. Pat. No. 5,488,616 is concerned with a system for providingreversible variable length codes. To this end, an asymmetricalreversible code is produced from a non-reversible variable length code,which is produced in provisional manner only. The non-reversiblevariable length code furthermore is converted to a symmetricalreversible code. A selection means selects either the asymmetricalreversible code or the symmetrical reversible code as output signal. Thesymmetrical reversible code is represented by a complete code tree inwhich all branches are concluded either by symmetrical code words or bybranching points, with these branching points in turn being concluded bya symmetrical code word or leading to further branching points. The codetree contains exclusively symmetrical code words.

EP 0 732 855 A2 discloses a system of coding and/or decoding videoimages using variable length code words. The coder comprises a firstcoder having a code word table for source symbols in a region of sourcesymbols, with this code table containing variable length code wordsassigned to source symbols. The source symbols that can be coded byvariable length code words of the first code table have a relativelyhigh probability of occurrence. A source symbol for which there is nocode word from the first code table is input to a second coder having acode table with fixed length code words, in order to assign a fixedlength code word to the source symbol. In addition thereto, an escapecode is placed upstream and downstream of the fixed length code word,with said escape code being taken from the code table of the first coderhaving variable length code words. The variable length code words of thefirst coder are reversible code words, whereas the code words of thesecond coder are of fixed length. This produces a single data streamconsisting of reversible variable length code words and of escape codes,with a fixed length code word being arranged between two escape codeseach. This data stream can be decoded both in forward and in backwarddirection, with a decoder, upon coming across an escape code,recognizing the group of bits following the escape code, as a fixedlength cod e word, since the decoder has information on the number ofbits in the group, i.e. on the length of the fixed length code words.

It is the object of the present invention to make available a conceptionfor entropy encoding of information words and for decodingentropy-encoded information words which permits improved errorrecognition in case of transmission of the entropy-encoded informationwords via an error-inflicted channel while nevertheless providing for anoptimum possible coding efficiency.

This object is met by a device for entropy encoding according to claim1, by a device for decoding according to claim 10, by a method forentropy encoding according to claim 19 and by a method for decodingaccording to claim 20.

The present invention is based on the finding that only thoseinformation words can be transmitted in effectively error-robust mannerwhich are coded by reversible, e.g. symmetrical code words. Onlyreversible code words permit forward and backward coding of a sequenceof code words that is unequivocally associated with a sequence ofinformation words. In contrast to the Huffman code, which hasunsymmetrical code words, but is nearly optimum for reasons of datacompression, a symmetrical code has higher redundancy. This redundancycan be advantageously utilized for error recognition. However, in orderto not sacrifice too much compression gain for obtaining error-safeness,not all information words are coded by means of symmetrical code wordsaccording to the present invention, but only those information wordsthat are within a specific region of information words. Informationwords lying outside the region are not coded by means of the symmetricalcode, but can be Huffman-coded according to a preferred embodiment ofthe present invention. Thus, a compromise is made betweenerror-robustness on the one hand and data compression on the other hand.

Another important aspect for the size of the region of information wordscoded by symmetrical code words is the fact that a short code, i.e. asmall code table, is desirable for error localization. The size of theregion implicitly determines the length of the longest code word, sincewith increasing number of code words in the table the length of thevalid code words increases as well.

Error localization, according to the invention, is carried out in that adecoder recognizes invalid, i.e. non-reversible, code words andconcludes therefrom that a transmission . . . [ . . . error is presenthere, as such a code word by definition was not produced in the coder.]

The present invention is based on the finding that only thoseinformation words can be transmitted in effectively error-robust mannerwhich are coded by reversible, e.g. symmetrical code words. Onlyreversible code words permit forward and backward coding of a sequenceof code words that is unequivocally associated with a sequence ofinformation words. In contrast to the Huffman code, which hasunsymmetrical code words, but is nearly optimum for reasons of datacompression, a symmetrical code has higher redundancy. This redundancycan be advantageously utilized for error recognition. However, in orderto not sacrifice too much compression gain for obtaining error-safeness,not all information words are coded by means of symmetrical code wordsaccording to the present invention, but only those information wordsthat are within a specific region of information words. Informationwords lying outside the region are not coded by means of the symmetricalcode, but can be Huffman-coded according to a preferred embodiment ofthe present invention. Thus, a compromise is made betweenerror-robustness on the one hand and data compression on the other hand.

Another important aspect for the size of the region of information wordscoded by symmetrical code words is the fact that a short code, i.e. asmall code table, is desirable for error localization. The size of theregion implicitly determines the length of the longest code word, sincewith increasing number of code words in the table the length of thevalid code words increases as well.

Error localization, according to the invention, is carried out in that adecoder recognizes invalid, i.e. non-reversible, code words andconcludes therefrom that a transmission error is present here, as such acode word by definition was not produced in the coder. The probabilitythat a disturbance leads to an invalid code word, is highest when thereis just a small number of code words present. If a very large number ofcode words exists, the probability of a disturbance resulting in aninvalid code word becomes increasingly smaller since the length of theinvalid code words becomes increasingly longer as well.

The method according to the invention is advantageous in particular insuch cases in which the information words to be coded are substantiallywithin a region, and information words are outside this region withlittle probability only. The smaller this region, the fewer symmetricalcode words are necessary and the better the error detection, which couldbe increased by the addition of artificial invalid code words. Thus, itis attempted to select the region of the information words coded bysymmetrical code words as small as possible in the sense of efficienterror localization, but to select it nevertheless so large that theinformation words are within this region with great probability and arecoded symmetrically, in order to provide for an in total sufficienterror robustness.

A preferred use of the present invention consists in entropy encoding ofscale factors of a transformation-encoded audio signal, since with thisuse, seen statistically, 98% of the scale factor values occurring arewithin a graspable region that can be coded by symmetrical code wordsthat are not yet of excessive length. If an information word outside ofthis region is to be entropy-encoded, an additional value is transmittedwhich is referred to as “escape”. The escape value preferably is Huffmancoded and transmitted separately from the symmetrically coded scalefactors in the audio bit stream.

The sense of entropy encoding according to the invention thus consistsin being able, despite a relatively small RVLC table, to cover a largeregion of code words with good error recognition properties. The codingefficiency hardly suffers in the preferred application mentioned, sinceescape-encoded values occur only rarely there.

The application of the present invention to the scale factors of atransformation-encoded audio signal is advantageous in particular asalready smaller disturbances in the scale factors due to a non-idealchannel lead to strongly audible disturbances since, as is known, ascale factor weights several spectral lines in multiplicative manner.Since, furthermore, the scale factor, as compared to the coded spectralvalues, make up a relatively small part of the entire bit quantity only,protection of the scale factors by a redundant code does not result in aconsiderable additional expenditure of bits. This slight additionalexpenditure is more than justified by the error-safeness of the scalefactors which, as compared to their bit quantity, may introduce by farhigher disturbances into an audio signal.

However, the present invention is not restricted to entropy encoding anddecoding of scale factors, but is advantageous in all situations whereinformation words are to be coded which are within a region with highprobability, such that one can make do with relatively short symmetricalcode words without great loss in efficiency, and in which values outsidesaid region can be encoded by escape sequences.

Preferred embodiments of the present invention will be explained in thefollowing with reference to the accompanying drawings in which

FIG. 1 shows a schematic block diagram for a coder according to thepresent invention;

FIG. 2 shows a schematic block diagram for a decoder according to thepresent invention;

FIG. 3 shows a schematic representation of the stream of code wordsprocessed by the decoder shown in FIG. 2;

FIGS. 4A to 4C show symmetrical codes according to the prior art; and

FIG. 5 shows a reversible code according to the present invention.

Before discussing the figures in detail, however, some general aspectsof entropy encoding shall be indicated. In particular, the specialaspects in coding differentially encoded values shall be discussed,which can be advantageously combined with coding by means of symmetricalcode words and escape values.

The code according to the invention represents an entropy code which,similarly to the frequently employed Huffman code, assigns short codewords to frequently occurring values and long code words to rarelyoccurring values. However, the code according to the invention differsfrom the Huffman code in the following:

The coding employed, in contrast to Huffman coding, permits first of alldecoding from both sides (forward and backward). This is also referredto as “reversible variable length coding” (RVLC) in technology. Backwarddecoding is possible if reversible, e.g. symmetrical code words, areemployed, i.e. if a code book or a code table with reversible code wordsis employed.

In addition thereto, the use of RVL codes permits the effect that thecode table, i.e. the quantity of code words available, does notconstitute a “complete tree”. Thus, there are code symbol sequencesyielding no valid code word, i.e. yielding code words that are notsymmetrical.

The gaps arising in the tree can be utilized for detecting transmissionerrors, as they point out that a code word received never has beenproduced by a transmitter.

Due to the fact that Huffman coding is optimum in terms of informationtheory, it does not make sense to use a different code when the sole aimconsists in maximizing data compression. However, if the aim is anincrease in error insensitivity with as little loss in compressionefficiency as possible, the Huffman code is not advantageous. By codingwith variable length code words, an error can propagate from thedisturbed code word to all subsequent code words. A bit error thusdistorts the length of a code word, which has the effect that allsubsequent code words in a code word sequence cannot be decoded any moreas the decoder has no knowledge as to where the corresponding code wordsbegin.

If, instead of a variable length code such as e.g. the Huffman code, areversible variable length code is employed, an error changing thelength of a code word as a rule can be diagnosed very quickly due to thepresence of invalid code words. If an invalid code word is revealed,decoding is stopped. This is not possible in Huffman coding since allcode words are valid and invalid code words thus do not exist. Inaddition thereto, the RVLC permits backward coding, whereby improvedlocalization of the error is possible. This shall be illustrated by wayof the following example. A code table according to the invention, forexample, could read as follows:

Information word Code word 3 110011 2 11011 1 111 0 0 −1 101 −2 1001 −310001

The region for information words that can be coded by those code tablealone by means of symmetrical code words thus is from −2 to +2. Valuesoutside of these limits, i.e. which in their amount are greater than 2,are provided with an escape value in addition to the symmetrical codeword for −3 and +3, respectively.

Code words that cannot occur in the code table shown, are the followingones:

10000

11000

110010

11010

As regards a detailed representation of a code according to theinvention, reference is made to FIG. 5 and the corresponding discussionfurther below.

In the following, a sequence of FIGS. 1, −3, 1, 2, −1 is to beconsidered as a fictive example in the following, which is to betransmitted over an error-inflicted channel:

TABLE 2 Sequence of information words: 1, −3, 1, 2, −1 Sequence of codewords: 111 10001 111 11011 101

Considering the case that an error produced by the channel causesdisturbance of the twelfth bit, the following bit sequence results:

Disturbed sequence of code words: 111, 10001, 111, 01011, 101

Forward decoding of five values yields 11, 10001, 111, 0, 101, i.e. 1,−3, 1, 0, −1.

However, backward decoding results in the following sequence:

101, 11010,

i.e. just −1 and an invalid code word. It can be seem from this simpleexample that by decoding from the rear, i.e. backward decoding, theinvalid code word 01011 is recognized very quickly. Furthermore, bystopping of the decoding operation after the invalid code word, theerror can be localized and identified very quickly. Thus, backwarddecoding reports an error in the region of the last bit up to the eighthbit from the rear.

The two decoded sequences of figures read as follows. Printing in boldin the following table means that the values may contain errors:

Forward: 1 −3 1 0 −1

Backward: x x x x −1

The extent to which error localization is possible here is dependent onthe type of the error and the error concealing techniques implemented.Known error concealing techniques consist in simple replacement of anerroneous value by its neighboring intact value. On the other hand, ifboth intact values neighboring an error are known, weighted averagevalues from the left-hand or right-hand edge may be used forartificially replacing, i.e. concealing, the erroneous value. Stillother error concealing techniques employ an interpolation using twoneighboring values between which an error is present. It is possiblejust as well to make use of a unilateral prediction from the front orthe back in order to replace an erroneous value by a “possiblyrelatively intact” value.

FIG. 1 shows an entropy encoder according to a preferred embodiment ofthe invention. Information words to be coded are input in a decisionmeans 10. In the preceding tables, information words consisted ofintegers only for the sake of simplicity. In an audio encoder,information words to be entropy-encoded, such as e.g. scale factors,will be present in the form of eight-bit-values, for example. The term“information words” thus is supposed to comprise any kind ofrepresentation in which information to be coded can be represented.

It is decided in said decision means 10 whether the information word iswithin a region of information words or outside the region ofinformation words. The region is determined by the code tableimplemented in the coder. If it is decided in said decision means thatan information word to be coded is within the region, said informationword is transferred to means 12 for assigning a symmetrical code wordfrom a group of symmetrical code words, i.e. from the code table, suchthat a symmetrical code word is assigned to the information word. If,however, the decision means 10 decides that the information word isoutside the region defined by the code table, this information word istransmitted by decision means 10 to means 14 for producing an additionalvalue, such that the means 14 ascertains the escape value in a preferredembodiment of the present invention. Means 14 on principle has twooutputs, i.e. an output for writing the escape value into an escaperegion of the bit stream, and on the other hand an output connected to abit stream formatter 16 producing a stream of code words or a sequenceof code words that is associated with the sequence of information wordsfed to the input of decision means 10.

For more detailed explanation of the mode of operation of the means forproducing an additional value or escape value, which in FIG. 1 bearsreference numeral 14, reference is made to FIG. 3. FIG. 3 shows acontinuous stream 30 of “potentially” symmetrical code words, with theterm “potentially” being supposed to point out that the stream hasalready been transmitted over a non-ideal channel, e.g. the radio path,whereby bit disturbances may have occurred. The stream consists ofindividual symmetrical code words 30 a, 30 b, 30 c, etc. which are allwithin the region defined by the code table comprising symmetrical codewords. The stream of potentially symmetrical code words, however,comprises furthermore symmetrical code words 31, 32 standing forinformation words at the edge of the region. The code words 30 a to 30 care generated by the assignment means 12 and fed into bit streamformatter 16. The code words, existing for information words at the edgeof the region, in a preferred embodiment of the present invention areproduced by means 14 and fed from there to the bit stream formatter 16which forms the stream 30 depicted in FIG. 3. The code words 30 a to 30c as well as 31 and 32 represent information words from −7 to +7, i.e.information words having symmetrical code words assigned thereto. If theinformation word to be encoded has a value of +12 for example, the sumof the symmetrical code word 31 and the escape value yields the value+12.

A decoder coming across code word 31 will immediately recognize thatthis is a code word at the edge of the region, and the decoder, fordecoding the information word, will therefore “go” to the escape regionby means of link A in order to find out there that an escape value of,in the present example, 5 is present. According to a preferredembodiment of the present invention, the production means 14 thusperforms two functions. On the one hand, it delivers the code word forthe edge of the region to the stream 30 of symmetrical code words. Onthe other hand, it forms the difference between the information word tobe coded and the code word at the edge of the region, and produces anescape value which represents the difference. The escape value, ofcourse, may be entropy-encoded again by means of the coding methodaccording to the present invention. However, it is preferred for reasonsof data compression to encode the escape value by means of the Huffmancode. Moreover, it can be seen from FIG. 3 that the escape value is notwritten into the stream of symmetrical code words, but to a differentlocation in the bit stream.

If the value −12 is to be encoded, the decision means 10 will determinethat this value is outside the region defined by the code table withsymmetrical code words. The means 14 for producing an additional value,thus, will output the code word for the value −7 to the bit streamformatter 16 on the one hand and on the other hand will write thedifference, i.e. 5, into the escape region. The value −12 then resultsfrom the combination of the value −7, in FIG. 3 e.g. the code word 32,and the escape value 34 via the link illustrated by arrow B.

A value of +7 in the preferred embodiment of the present invention wouldbe encoded as code word for +7, i.e. as code word 31, and 0 in theescape region, i.e. as escape value 33.

Differently from the embodiment described, it is not cogent that themeans 14 for producing an additional value establishes the difference ofthe information word to be coded and the information word at the edge ofthe region and on the one hand writes a symmetrical code word into thestream 30 of symmetrical code words and on the other hand writes thedifference into the escape region. As an alternative, it is alsopossible that the entire information word is written into the escaperegion, and that the stream of symmetrical code words just has a dummyor specific bit combination or the like inserted therein, either by themeans 14 or by the bit stream formatter 16, in order to signal to adownstream decoder that it has to switch to the escape region at thislocation in the bit stream. However, the method shown provides for theadvantage that at least that part of the information word that is in theregion covered by symmetrical code words, is coded by means of asymmetrical code word, whereby only the difference, which is coded e.g.by means of a Huffman code, is secured or error-resistant to a lesserextent. In contrast thereto, the alternative method would have theadvantage that no addition or formation of the difference would have tobe carried out, and that the less redundant code is used for aninformation word outside the region. However, it is disadvantageous thatthe information word lying outside the region then cannot bebackward-encoded. It is however possible to make use of methods known inthe prior art or the method according to the invention for protection ofthe escape region, in order to create safe conditions here as well.

FIG. 2 shows a preferred embodiment of a decoder according to thepresent invention. A sequence of code words or a stream of “potentiallysymmetrical code words” 30 is fed into a memory 20 which can be accessedby an analyzer 21 for analyzing a sequence stored in memory 20. Theanalyzer 21 comprises on the one hand means for detecting a symmetricalcode word from the sequence 30 of code words and on the other hand meansfor detecting a predetermined code in the sequence 30 of code words. Ifanalyzer 21 detects an intact symmetrical code word, it will transmitthe same to means 22 for assigning a specific information word to thecode word on the basis of a known code table that has to correspond tothe code table used in the coder (FIG. 1). However, if analyzer 21detects a predetermined code which in the present example, is the codeword for an edge of the region, it will pass this code word to means 23for ascertaining an additional information word outside of the region.In the preferred embodiment means 23, upon occurrence of the code word31 in stream 30, will access the escape region and retrieve thecorresponding escape value there and add or, respectively, subtract thesame from the information value corresponding to code word 31.

The assignment of a predetermined code, in the embodiment the code wordfor an information word at the edge, to a code word in the escape regioncan be effected in different ways. The simplest possibility is the useof a continuous pointer, with both the escape region and the stream 30being synchronized. This synchronization in the preferred embodiment ofthe present invention, in which scale factors are entropy-encoded, isestablished in that there is processed at all times one block or frameof an audio signal. For each block, the escape region and the stream 30of symmetrical code words are initialised, so that the use of acontinuous pointer produces correct results.

The coder according to the invention comprises furthermore means 24 forreversing the decoder sequence that is activated by the analyzer 21. Ifthe analyzer 21 finds an unsymmetrical code word in stream 30, it willactivate said means 24 for reversing the sequence, since anunsymmetrical code word cannot occur in stream 30 of potentiallysymmetrical code words. The assignment means 22 and the ascertainingmeans 23 then operate in the reverse sequence from the other end of thesequence of code words in order to localize the error by backwarddecoding, so that only as few as possible values will have to bereplaced by error concealing.

In reality, it may happen that an entropy decoder will not immediatelyrecognize an erroneous code word since the disturbance did not result inan invalid code word. Decoding will thus take place beyond the erroruntil the decoder, due to a subsequent error, comes across an invalidcode word and then stops coding. The backward decoder then decodes fromthe other end, possibly also beyond the erroneous code word, and at sometime will stop at an invalid code word. A region of overlap has thusbeen created in which both the entropy forward and the entropy backwarddecoder delivered output values. The error is thus localized to theoverlapping region, and it can be established that the decoded valuesoutside the overlapping region are correct.

If differential coding has been carried out in the coder, thecorresponding decoder comprises furthermore a differential decoder 25which cancels the differential coding produced in the coder. Thedifferential decoder 25, according to the invention, is also activatedby the sequence reversing means 24 to carry out backward differentialdecoding, in order to produce from differential-encoded informationwords transmitted to means 25 by means 22 and 23, information words thatare completely decoded in backward direction as well. It is to bepointed out that the backward differential decoder and the forwarddifferential decoder may be separate means, or that they are implementedby one single means, with an addition being carried out in forwarddifferential decoding whereas a subtraction takes place in backwarddifferential decoding.

The combination of differential coding with the coding method accordingto the invention is particularly advantageous, since only differentialcoding with a suitably selected starting value of difference formation,causes the absolute information words to be “shifted”, e.g. by a regionsymmetrical to zero.

However, for permitting differential decoding 25 in backward directionfrom the other end of a sequence of information words, an additionalvalue must be added at the end of the sequence of information words inthe coder, such that the differential decoder knows from where backwarddifferential coding is to be started. If a fixed starting value has beenused in differential coding, the additional value can be created by anadditional differential value at the end of the sequence ofdifferential-encoded information words, which indicates the differencefrom the last information word to the fixed or predetermined startingvalue. The difference, of course, is entropy-encoded as well andpreferably is entropy-encoded by means of a symmetrical informationword, such that this value is well protected to permit backwarddecoding. If the first information word of a sequence of informationwords is used as starting value for differential-encoding in the coder,it is favorable to add the absolute value of the last information wordas additional value at the end of the sequence. This last value quitecertainly will not be in the region of information words that are codedwith symmetrical code words.

As was already mentioned, a preferred application of the presentinvention consists in coding scale factors that so far were firstsubjected to differential coding and then to Huffman coding. The priorart makes use of a Huffman table with 121 code words in order to be ableto code values in the region from −60 to +60. Due to the fact that thenumber of scale factors to be coded is very small as compared with thenumber of spectral values, with 40 being a typical value, relatively“rapid” detection of errors is absolutely necessary, so that the decoderstops after decoding of just a few values, so that a relatively gooderror localization is rendered possible. This is why a “small” codetable is employed, which means that the number of symmetrical RVLC codewords should be small.

The smaller the code table or code book, the more likely is an earlierrecognition of errors. The region for information words codedsymmetrically therefore extends from −7 to +7. For values in the regionfrom 7 to 60, the escape value is transmitted. The same is preferablysubjected to Huffman coding. The “escape” table thus consists of 54entries for values between 0 and 53. Each time the receiver decodes a −7or +7, it must thus decode the associated escape value and perform anaddition and subtraction thereof, respectively.

Seen in terms of statistics, the interval from −7 to +7 covers 98% ofthe scale factor values occurring, so that escape values do not occurvery often. If more frequent escape values should occur or if even moreattention is paid to error safety, there may be employed various knownmethods as well as the method according to the invention to provide alsothe escape values with higher error robustness.

For explaining the reversible variable length code according to theinvention, FIG. 4A will be dealt with first which shows a knownsymmetrical code disclosed e.g. in the initially mentioned technicalpublication by Göran Bang and Göran Roth. This code is defined by a codetree having a root 40 and a branching point 42. As there is a binarycode involved, the root has two branches 43, 44 applied thereto, withbranch 43 connecting the root 40 to an end point defining the valid codeword “1”. Branch 44 connects the root 40 to branching point 42 havingtwo branches 45, 46 extending therefrom. Branch 46 is connected to anend point defining the second valid code word “00” of this code, whereasbranch 45 defines an invalid code word of this code, i.e. “01”. Codeword “01” is invalid since it is unsymmetrical. As regards the furthernotation, it is pointed out that invalid code words in FIGS. 4A and 4Bas well as in FIG. 5 are surrounded by frames. The code shown in FIG. 4Athus comprises only two valid code words, i.e. “1” and “00” and only onesingle invalid code word, i.e. “01”, which has the same length as thesecond valid code word “00”.

A somewhat longer code is illustrated in FIG. 4B. Contrary to FIG. 4A,the code in FIG. 4B contains an additional valid code word “010” as wellas an invalid code word which, like the additional valid code word, alsois 3 bits long and has the value “011”. Differently from FIG. 4A, branch45 is not connected to an end point, but to an additional branchingpoint 47 having two branches extending therefrom, with the first branchthereof extending to the additional valid code word “010” and the otherbranch extending to the sole invalid code word “011”.

FIG. 4C is the logical continuation of FIGS. 4A and 4B, since thebranching point 47 now is connected to an additional branching point 48,from which there are again two branches extending, one branch thereofdefining an additional symmetrical code word “0110”, whereas the endpoint of the other branch defines the sole invalid code word “0111” thathas the same length (4 bits) as the longest code word of the code tree,i.e. the code table.

FIG. 4C shows in addition that there are no valid code words of the samelength. This holds for the codes in FIGS. 4A and 4B as well.

The codes illustrated in FIGS. 4A to 4C, in the technical publication byGöran Bang and Göran Roth, are just utilized as safety patterns and notas codes for coding information, since such a code, as is easilyperceivable by logical continuations of the codes shown in the figures,becomes very long with a sufficiently high number of code words.Moreover, the error robust nature of correspondingly longer codes isvery low, since there is always only one invalid code word in existenceand, moreover, this invalid code word has the same length as the longestvalid code word. Coding of information with the known codes thus is notadvisable as the code words become very long if an appropriate region ofinformation values is to be coded, and since there is always only onecode word existing which in addition thereto is very long. A decoderthus will not recognize an error immediately and commit a large numberof subsequent errors before it comes across an invalid code word andstops decoding. The error is therefore localized poorly.

The code table according to the invention shown in FIG. 5 overcomesthese disadvantages in that the code tree has at least one branchingpoint from which two branches emanate that are both connected to abranching point instead of an end point. In the preferred embodiment forthe reversible variable length code, as shown in FIG. 5, these are thebranching points 50 a, 50 b, 50 c and 50 d. The code tree in FIG. 5comprises furthermore are root 52 from which two branches 53 and 54extend, branch 53 being connected to an end point which defines thefirst and shortest code word 0, which in the preferred embodiment hasthe information value “0” assigned thereto. The code word 0 has theshortest length and, with respect to entropy encoding, thus isassociated with the information value occurring most frequently. In thepreferred embodiment according to the present invention, in which theinformation values are differential-encoded, it has turned out that thevalue 0 occurs with the highest probability in differential coding ofscale factors.

The other branch emanating from root 52, i.e. the branch 54, accordingto the invention does not terminate in a code word with a length of 2bits, but leads to branching point 50 a which in turn is connected, viatwo branches 55, 56, to additional connecting points 57, 58. Theconnecting points 57 and 58 in turn are connected via correspondingbranches 59, 60, to end points defining the valid code words 101 and111. In contrast to the prior art, it can be seen here that, bydispensing with a code word with a length of 2 bits, it is possible toobtain two code words of equal length, i.e. 3 bits in FIG. 5. These arecode words 101 and 111. In the code table shown in FIG. 5, these areassigned the information values “−1” and “1”. It is advantageous underthe aspect of entropy encoding to provide also code words of equallength for two information values which very likely occur with the samefrequency.

It can be seen from FIG. 5 that connecting point 50 c has two branches62, 63 starting therefrom, branch 63 being connected to a connectingpoint 64 which via branches is connected to a valid code word 110011 andto an invalid code word 110010. If, for example, a decoder then comesacross the invalid code word 110010, it will stop the coding operationas such a code word is not reversible and never has been generated in acoder.

The creation and assignment of additional code words to informationvalues can be seen from FIG. 5. However, reference is to be made to aspecial aspect. A preferred application of the code according to theinvention as shown in FIG. 5 consists in the utilization of thereversible code in conjunction with escape values. As has already beenpointed out, an information value outside the region from “−7” to “+7”will be coded by the code word for the corresponding information valueat the edge of the region and the difference beyond the same will becoded in an escape table. Thus, there is a higher probability that, inthe coded bit stream, the value at the edge of the region, i.e. “−7” and“+7”, respectively, has to be coded. Furthermore, the probability isequally high that “−7” or “+7” occurs. According to a preferredembodiment of the present invention, the information values “−7” and“+7” are coded by code words of equal length, i.e. 1000001 and 1100011,respectively, with these code words being at the same time shorter thanthe longest code words occurring, which in the instant case are the codewords for “−6” and “+6”, so as to provide a code table that is as goodas possible under entropy aspects.

Furthermore, it can be seen from FIG. 5 that there are eight invalidcode words 66 a to 66 h, whereas a reversible code according to theprior art has or can have at all times only one single code word. Alarge number of invalid code words and in particular relatively shortinvalid code words, such as e.g. the code words 66 e, 66 f, provides forhigh error robustness, such that a decoder stops decoding as fast aspossible after an erroneous information value so that an error can belocalized within as narrow limits as possible.

Finally, it should be summarized that the reversible variable lengthcode shown in FIG. 5 is suited particularly well for error-robustentropy encoding of information words, since on the one hand there arerelatively many short invalid code words in existence and since on theother hand, at the sacrifice of one shorter code word (in the examplethe code word “11”), there are obtained two code words (in the example101 and 111) which, though being longer, have the same probability.Although dispensing with a valid short code word actually should beavoided with respect to entropy encoding, this nevertheless provides fora good solution according to the invention in applications in whicherror-robust entropy encoding is to be carried out and in which occur inaddition two information values with relatively high probability and inparticular with approximately the same probability. As regards the codetable representation in the form of a tree, said dispensing with isachieved by the fact that there are special branching points from whichtwo branches emanate, which however, instead of being connected to anend point, are both connected to additional branching points.

What is claimed is:
 1. A device for entropy encoding of informationwords, comprising: means for assigning a reversible code word from agroup of reversible code words to an information word which is locatedwithin a region of information words, the group of reversible code wordsbeing designed such that, for each information word within the region,there is provided one specific reversible code word each; means forproducing a predetermined additional code word for an information wordwhich is located outside the region of information words, for producingan additional value for the information word located outside the regionof information words, and for assigning a non-reversible variable lengthcode word from a group of non-reversible variable code words to saidadditional value, with an escape region being produced that is separatedfrom the data stream of reversible code words and consists ofnon-reversible variable length code words, there being always assignedone code word of the escape region to one of the predetermined codewords of the data stream of reversible code words each; and data streamformatting means connected to the means for assigning and to the meansfor producing and being arranged to produce a data stream of reversiblecode words comprising only reversible code words for information wordswithin said region and comprising predetermined reversible code wordsfor information words outside said region.
 2. A device according toclaim 1, wherein the reversible code words are symmetrical code words.3. A device according to claim 1, wherein the means for producing isarranged such that it produces an additional value also for aninformation word located on a boundary of said region of informationwords and such that it produces the predetermined code word for theinformation word located on the boundary of said region of informationwords.
 4. A device according to claim 1, which is designed such thatinformation words occurring with a probability of occurrence that isabove a predetermined limit probability, are located in said region. 5.A device according to claim 1, wherein the means for assigning isarranged such that the size of the region is selected so that the lengthof the longest code word of the group of reversible code words issmaller than or equal to a predetermined length defined by errorrecognition aspects.
 6. A device according to claim 1, wherein the meansfor producing is arranged so as to form as additional value thedifference between the information word and the information word on aclosest boundary of said region.
 7. A device according to claim 1,wherein the information words each correspond to numerical values from afirst to a second boundary and numerical values outside the boundaries,said first and second boundaries defining said region of informationwords, wherein the means for assigning is arranged to assign to aninformation word located on a boundary or outside said region, thepredetermined reversible code word, the predetermined reversible codeword corresponding to the reversible code word provided according to thecode table for the information word corresponding to the boundary of theregion which, on the basis of its numerical value, is closest to thenumerical value of the information word; and wherein the means forproducing produces the difference between the information word to becoded and the information word on the boundary of the region as anadditional value, the sign of the difference being determined by thesign of the information word on the boundary of the region, such thatthe information word to be coded is represented by the predeterminedreversible code word for the information word on the boundary of theregion and by a sign-free difference as additional value.
 8. A deviceaccording to claim 1, further comprising: means for differentialencoding of information which, on the basis of a starting value,produces differential-encoded information words, with successivedifferential-encoded information words representing a differential valuesequence.
 9. A device according to claim 8, wherein the means fordifferential encoding further comprises: means for adding an additionalelement to the end of the differential value sequence, the additionalelement being defined such that backward decoding of the differentialvalue sequence can be carried out.
 10. A device according to claim 1,wherein the information words are scale factors of atransformation-encoded audio signal.
 11. A device for decoding ofinformation words that are entropy-encoded using reversible code words,said information words being present in the form of a data stream and anescape region, the data stream comprising only reversible code words forinformation words with a region of information words and the escaperegion comprising non-reversible code words for additional valuesrepresenting information words outside the region of information words,there being always assigned one code word of the escape region to onepredetermined code word of the data stream each, said device comprising:means for detecting a reversible code word from the data stream; meansfor assigning a specific information word to the code word detected fromthe data stream, on the basis of a code table; means for detecting apredetermined reversible code word in the data stream; means forascertaining outside of said region on the basis of the predeterminedcode a non-reversible variable length code word in the escape region,which is assigned to the predetermined reversible code word detectedfrom the data stream, for assigning an additional value to thenon-reversible variable length code word on the basis of an escape tablefor the non-reversible variable length code words, and for ascertainingan information word outside of the region of information words on thebasis of the additional value.
 12. A device according to claim 10,wherein the non-reversible variable length code words are Huffman codewords.
 13. A device according to claim 10, wherein the means fordetecting a reversible code word is arranged such that a non-reversiblecode word in the first data stream can be ascertained.
 14. A deviceaccording to claim 12, further comprising: means for reversing asequence in which said means for detecting processes the code wordsequence, said means for reversing being responsive to a non-reversiblecode word being ascertained.
 15. A device according to claim 13, whereinthe sequence of information words, starting from a starting value, isdifferential-encoded, the sequence furthermore having at the other endthereof an additional value which is selected such that backwarddifferential decoding from the other end can be carried out, said meansfor differential decoding being arranged to carry out differentialdecoding from the other end responsive to said means for reversing thesequence.
 16. A device according to claim 10, wherein the informationwords are differential-encoded and which further comprises: means fordifferential-decoding the differential-encoded information words.
 17. Adevice according to claim 10, wherein the predetermined reversible codeword is the code word assigned according to a code table to aninformation word on a boundary of the region of information words.
 18. Adevice according to claim 16, wherein the means for ascertaining isarranged to form the sum of the information word on a boundary of theregion and of the additional value, so as to obtain an information wordlocated outside said region.
 19. A method for entropy encoding ofinformation words, comprising: assigning a reversible code word from agroup of reversible code words to an information word which is locatedwithin a region of information words, the group of reversible code wordsbeing designed such that, for each information word within the region,there is provided one specific reversible code word each; producing apredetermined reversible code word for an information word locatedoutside said region of information words; producing an additional valuefor the information word which is located outside said region ofinformation words; producing a data stream of reversible code wordscomprising only reversible code words for information words within saidregion and comprising predetermined reversible code words forinformation words outside said region; and coding the additional valueby assigning a non-reversible variable length code word from a group ofnon-reversible variable length code words to the additional value, withan escape region being produced which is separated from the data streamof reversible code words and consists of non-reversible variable lengthcode words, there being always assigned one code word of the escaperegion to one of the predetermined code words of the data stream each.20. A method for decoding of information words that are entropy-encodedusing reversible code words, said information words being present in theform of a data stream and an escape region, the data stream comprisingonly reversible code words for information words within a region ofinformation words and the escape region comprising non-reversible codewords for additional values representing information words outside theregion of information words, there being always assigned one code wordof the escape region to one predetermined code word of the data streameach, said method comprising the following steps: detecting a reversiblecode word from the data stream; assigning a specific information word tothe code word detected from the data stream, on the basis of a codetable; detecting a predetermined reversible code word in the datastream; ascertaining a non-reversible variable length code word in theescape region, which is assigned to the predetermined reversible codeword detected from the data stream; assigning an additional value to thenon-reversible variable length code word on the basis of an escape tablefor the non-reversible variable length code words; and ascertaining aninformation word outside of the region of information words on the basisof the additional value.